package com.woniu.new_orange.entity;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 * @TableName user
 */
@Data
@ApiModel("用户类")
public class User implements Serializable {
    @ApiModelProperty("用户id")
    private Integer userId;
    @NotBlank(message = "用户名不能为空")
    @Length(message = "用户名长度不能超过{max}个字符",max = 10)
    @ApiModelProperty("用户昵称")
    private String userName;
    @ApiModelProperty("用户账户")
    private String userAccount;
    @NotBlank(message = "密码不能为空")
    @ApiModelProperty("用户密码")
    private String userPassword;
    @NotBlank(message = "用户名不能为空")
    @Pattern(regexp = "^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\\d{8}$",message = "手机号码有误！")
    @ApiModelProperty("用户手机")
    private String userPhone;
    @ApiModelProperty("用户头像")
    private String userHeadImage;
    @Pattern(regexp = "^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*\\.[a-zA-Z0-9]{2,6}$",message = "邮箱格式不正确")
    @ApiModelProperty("用户邮箱")
    private String userEmail;
    @ApiModelProperty("用户年龄")
    private Integer userAge;
@DateTimeFormat(pattern = "ypyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@ApiModelProperty("用户生日")
private Date userBirthday;
    @ApiModelProperty("用户真实姓名")
    private String userRealName;
    @ApiModelProperty("用户身份证号")
    private String userIdCard;
    @ApiModelProperty("用户vip等级")
    private Integer vipId;
    @ApiModelProperty("用户资金编号")
    private Integer accountFundsId;
    private Integer userBy1;

    private String userBy2;

    private String userBy3;

    private static final long serialVersionUID = 1L;
}